<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    //    https://www.programminghunter.com/article/37441315453/
    function removeMultiple(arr){
        var result =[];
        arr.sort((a,b)=>a[1]-b[1]);
        result.push(arr.shift(0));
        for(var i=0;i<arr.length;i++){
            
        }
    }
    removeMultiple([[1,2],[2,3],[3,4],[1,3]])
    </script>
</body>
</html>